home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
dll_gen
/
winfox
/
filever.wd_
/
filever.wd
Wrap
Text File
|
1995-01-31
|
11KB
|
359 lines
VERSION 2.00
Begin Form FileVer
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "File Version Information"
ClientHeight = 5520
ClientLeft = 1245
ClientTop = 1140
ClientWidth = 6990
ControlBox = 0 'False
Height = 5925
Left = 1185
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5520
ScaleWidth = 6990
Top = 795
Width = 7110
Begin CommandButton CmdFileVersions
BackColor = &H00C0C0C0&
Caption = "&View Version Info"
Height = 375
Left = 960
TabIndex = 0
Top = 4440
Width = 5055
End
Begin TextBox Text1
Height = 285
Left = 360
MaxLength = 64
TabIndex = 2
Text = "Text1"
Top = 1080
Width = 3015
End
Begin FileListBox File1
Height = 225
Hidden = -1 'True
Left = 4920
Pattern = "*.DLL;*.DRV;*.EXE;*.OCX;*.VBX"
System = -1 'True
TabIndex = 6
Top = 3720
Visible = 0 'False
Width = 1575
End
Begin DirListBox Dir1
Height = 1155
Left = 3600
TabIndex = 3
Top = 240
Width = 3015
End
Begin DriveListBox Drive1
Height = 315
Left = 360
TabIndex = 4
Top = 240
Width = 3015
End
Begin ListBox FileList
FontBold = 0 'False
FontItalic = 0 'False
FontName = "Fixedsys"
FontSize = 9
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 1605
Left = 360
Sorted = -1 'True
TabIndex = 5
Top = 2460
Width = 6255
End
Begin CommandButton CmdOkay
BackColor = &H00C0C0C0&
Cancel = -1 'True
Caption = "O &K A Y"
Height = 375
Left = 960
TabIndex = 1
Top = 4800
Width = 5055
End
Begin Label LblFileCount
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = "Label2"
ForeColor = &H00800000&
Height = 195
Left = 2040
TabIndex = 9
Top = 1920
Width = 2895
End
Begin Label LblFullPath
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = "Label2"
Height = 195
Left = 360
TabIndex = 8
Top = 1560
Width = 6255
End
Begin Label Label1
BackStyle = 0 'Transparent
Caption = "Search Specification:"
ForeColor = &H00800000&
Height = 195
Left = 360
TabIndex = 7
Top = 840
Width = 3015
End
End
'file list box allow multiple selections
Dim PathWord As String
Dim FileSpec As String
Sub CmdFileVersions_Click ()
If FileList.ListIndex = -1 Then
MsgBox "No file selected to view!", 16, "Version Info"
Exit Sub
End If
ThisFile = FileList.List(FileList.ListIndex)
pos% = InStr(ThisFile, Chr$(9))
ThisFile = Left$(ThisFile, pos% - 1)
FullPath = dir1.Path
FullPath = BackSlashAdd(FullPath) + ThisFile
TheVersion = GetFileVersion(FullPath, "FileVersion")
If TheVersion = "" Then
msg$ = Chr$(34) + FullPath + Chr$(34) + nl + nl
msg$ = msg$ + "This file has no version stamping."
MsgBox msg$, 48, "Version Info"
Exit Sub
End If
Screen.MousePointer = 11
Comments = GetFileVersion(FullPath, "Comments")
CompanyName = GetFileVersion(FullPath, "CompanyName")
FileDescription = GetFileVersion(FullPath, "FileDescription")
InternalName = GetFileVersion(FullPath, "InternalName")
LegalCopyright = GetFileVersion(FullPath, "LegalCopyright")
LegalTrademarks = GetFileVersion(FullPath, "LegalTrademarks")
OriginalFilename = GetFileVersion(FullPath, "OriginalFilename")
PrivateBuild = GetFileVersion(FullPath, "PrivateBuild")
ProductName = GetFileVersion(FullPath, "ProductName")
ProductVersion = GetFileVersion(FullPath, "ProductVersion")
SpecialBuild = GetFileVersion(FullPath, "SpecialBuild")
msg$ = "File Version:" + Chr$(9) + TheVersion + nl
msg$ = msg$ + "Comments:" + Chr$(9) + Comments + nl
msg$ = msg$ + "Company Name:" + Chr$(9) + PathDotsRight(CompanyName, 28) + nl
msg$ = msg$ + "File Description:" + Chr$(9) + PathDotsRight(FileDescription, 28) + nl
msg$ = msg$ + "Internal Name:" + Chr$(9) + InternalName + nl
msg$ = msg$ + "Legal Copyright:" + Chr$(9) + PathDotsRight(LegalCopyright, 28) + nl
msg$ = msg$ + "Legal Trademarks:" + Chr$(9) + PathDotsRight(LegalTrademarks, 28) + nl
msg$ = msg$ + "OriginalFileName:" + Chr$(9) + OriginalFilename + nl
msg$ = msg$ + "Private Build:" + Chr$(9) + PrivateBuild + nl
msg$ = msg$ + "Product Name:" + Chr$(9) + PathDotsRight(ProductName, 28) + nl
msg$ = msg$ + "Product Version:" + Chr$(9) + ProductVersion + nl
msg$ = msg$ + "Special Build:" + Chr$(9) + SpecialBuild
Screen.MousePointer = 0
MsgBox msg$, 48, FullPath
End Sub
Sub CmdOkay_Click ()
Unload Me
End Sub
Sub Dir1_Change ()
Screen.MousePointer = 11
ChDir dir1.Path
LblFullPath.Caption = PathWord + LCase$(dir1.Path)
File1.Path = dir1.Path
DoFileList
Screen.MousePointer = 0
End Sub
Sub DoFileList ()
Screen.MousePointer = 11
On Error GoTo BadFileSpec
File1.Pattern = FileSpec
FileList.Clear
NbrFound% = File1.ListCount
If NbrFound% = 0 Then
FileWord$ = "No Matching Files Found"
ElseIf NbrFound% = 1 Then FileWord$ = "One Matching File Found"
Else
FileWord$ = Format$(NbrFound%, "###,##0") + " Matching Files Found"
End If
LblFileCount.Caption = FileWord$
If File1.ListCount = 0 Then
Screen.MousePointer = 0
Exit Sub
Else
For i = 0 To File1.ListCount - 1
TheFileName$ = File1.List(i)
FullPath$ = CurDir$
FullPath$ = BackSlashAdd(FullPath$) + TheFileName$
TimeStamp$ = FileDateTime(FullPath$)
TheFileDate$ = Format$(TimeStamp$, "dd mmm yyyy")
If Left$(TheFileDate$, 1) = "0" Then
TheFileDate$ = " " + Right$(TheFileDate$, Len(TheFileDate$) - 1)
End If
TheFileTime$ = Format$(TimeStamp$, "hh:mm am/pm")
If Left$(TheFileTime$, 1) = "0" Then
TheFileTime$ = " " + Right$(TheFileTime$, Len(TheFileTime$) - 1)
End If
TheFileSize$ = Format$(FileLen(FullPath$), "###,###,##0")
If Len(TheFileSize$) < 11 Then
AddSpace$ = Space$(11 - Len(TheFileSize$))
Else
AddSpace$ = ""
End If
TheFileSize$ = AddSpace$ + TheFileSize$
TheFileAttr% = GetAttr(FullPath$)
TheAttr$ = ""
If (TheFileAttr% And 32) <> 0 Then
TheAttr$ = TheAttr$ + "A"
Else
TheAttr$ = TheAttr$ + "-"
End If
If (TheFileAttr% And 4) <> 0 Then
TheAttr$ = TheAttr$ + "S"
Else
TheAttr$ = TheAttr$ + "-"
End If
If (TheFileAttr% And 2) <> 0 Then
TheAttr$ = TheAttr$ + "H"
Else
TheAttr$ = TheAttr$ + "-"
End If
If (TheFileAttr% And 1) <> 0 Then
TheAttr$ = TheAttr$ + "R"
Else
TheAttr$ = TheAttr$ + "-"
End If
FileList.AddItem TheFileName$ + Chr$(9) + TheFileDate$ + Chr$(9) + TheFileTime$ + Chr$(9) + TheAttr$ + Chr$(9) + TheFileSize$
Next i
End If
Screen.MousePointer = 0
Exit Sub
BadFileSpec:
Screen.MousePointer = 0
Beep
MsgBox "Invalid File Specification!", 16, "Data Entry Error"
Text1.SetFocus
Exit Sub
End Sub
Sub Drive1_Change ()
On Error GoTo SelDrvBad
Screen.MousePointer = 11
ChDrive Drive1.Drive
dir1.Path = Drive1.Drive
Screen.MousePointer = 0
Exit Sub
SelDrvBad:
Screen.MousePointer = 0
msg$ = "Drive Error " + UCase$(Left$(Drive1.Drive, 1)) + ":"
response = MsgBox("Can NOT Access Drive!", 21, msg$)
If response = 4 Then
Screen.MousePointer = 11
Resume 0
End If
WinRoot
Exit Sub
End Sub
Sub FileList_DblClick ()
CmdFileVersions_Click
End Sub
Sub Form_Load ()
FormCenterScreen Me
PathWord = "Full Path = "
On Error GoTo BadDrive3
LblFullPath.Caption = PathWord + LCase$(CurDir$)
ListHscroll FileList, 40
ReDim tabsets%(4)
tabsets%(0) = 0
tabsets%(1) = 16 * 4
tabsets%(2) = 30 * 4
tabsets%(3) = 42 * 4
tabsets%(4) = 44 * 4
dummy% = OutMessage(FileList.hWnd, 1043, 5, tabsets%(0))
FileSpec = "*.DLL;*.DRV;*.EXE;*.OCX;*.VBX"
Text1.Text = FileSpec
DoFileList
Screen.MousePointer = 0
Exit Sub
BadDrive3:
WinRoot
Resume Next
End Sub
Sub Form_Paint ()
DoForm3D Me, "raised", 2, 0
DoForm3D Me, "sunken", 2, 2
DoControl3D Drive1, "sunken", 1
DoControl3D dir1, "sunken", 1
DoControl3D Text1, "sunken", 1
DoControl3D FileList, "sunken", 1
DoControl3D LblFullPath, "sunken", 1
DoControl3D LblFileCount, "sunken", 1
End Sub
Sub Text1_GotFocus ()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Sub Text1_KeyPress (KeyAscii As Integer)
char = Chr(KeyAscii)
KeyAscii = Asc(UCase(char))
If char = "\" Then KeyAscii = 0
If char = Chr$(34) Then KeyAscii = 0
If char = Chr$(32) Then KeyAscii = 0
If char = ":" Then KeyAscii = 0
If char = Chr$(13) Then
KeyAscii = 0
SendKeys "{TAB}"
Exit Sub
End If
End Sub
Sub Text1_LostFocus ()
FileSpec = Text1.Text
DoFileList
End Sub
Sub WinRoot ()
Screen.MousePointer = 11
ReturnString$ = Space$(255)
ChDrive "c:"
ret% = GetPath("Windows", ReturnString$)
WinDir$ = TrimAtNull(ReturnString$)
WinDir$ = Left$(WinDir$, 3)
Drive1.Drive = WinDir$
ChDrive WinDir$
dir1.Path = CurDir$
LblFullPath.Caption = PathWord + LCase$(dir1.Path)
Screen.MousePointer = 0
End Sub